package com.java.shop.product.webvo;

import com.java.shop.product.entity.SkuImagesEntity;
import com.java.shop.product.entity.SkuInfoEntity;
import com.java.shop.product.entity.SpuInfoDescEntity;
import com.java.shop.product.vo.SeckillItemVo;
import lombok.Data;

import java.util.List;

@Data
public class SkuItemVo {
    //商品基本信息 pms_sku_info
    private SkuInfoEntity info;

    //商品图片信息 pms_sku_images
    private List<SkuImagesEntity> images;

    //spu的销售属性组合
    private List<SkuItemSaleAttrVo> saleAttr;

    //spu的介绍
    private SpuInfoDescEntity desp;

    //spu属性
    private List<SpuItemAttrGroupVo> groupAttr;

    private SeckillItemVo seckillVo;

    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVo> attrValues;
    }

    @Data
    public static class AttrValueWithSkuIdVo{
        private String attrValue;
        private String skuIds;  // 该销售属性在哪些sku中有出现 2,1,3
    }

    @Data
    public static class SpuItemAttrGroupVo{
        private String attrGroupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @Data
    public static class SpuBaseAttrVo{
        private String attrName;
        private String attrValue;
    }

}
